home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: new-news.sprintlink.net!news1!ind-004-236-163
- From: dlmiller@iquest.net (Doug Miller)
- Subject: Re: Float to String
- X-Nntp-Posting-Host: ind-004-236-163.iquest.net
- Message-ID: <DozDv5.69F@iquest.net>
- Sender: news@iquest.net (News Admin)
- Organization: IQuest Network Services
- X-Newsreader: News Xpress Version 1.0 Beta #2.1
- References: <4is29s$h1a@dfw-ixnews6.ix.netcom.com> <4j0m8a$1mem@darkwing.cadvision.com>
- Date: Thu, 28 Mar 1996 14:09:05 GMT
-
- douglasd@cadvision.com (Doran Douglas) wrote:
- >scoshe@ix.netcom.com(Christopher Scott Shelton ) wrote:
- >
- >>Is it possible to convert a float to a string? like the itoa function.
- >try strcpy 'ing the float to a string array
- >eg strcpy(string, float_variable_name);
- >
- >
- >
- Perhaps you should have tried that yourself... :) strcpy requires string arguments; your code
- won't even compile, let alone execute. The proper way to do this is with sprintf, e.g.
- sprintf (string, "%f", flt);
-
-